From 161b0a5c55433a10678de80cfed276d4d98bfa48 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Mon, 27 Mar 2006 17:00:01 +0000 Subject: [PATCH] bail out if there is no need for scrolling (more obvious than adding 2006-03-27 Michael Natterer * gtk/gtkmenu.c (gtk_menu_scroll_by): bail out if there is no need for scrolling (more obvious than adding additional conditions to the scroll offset calculation). Fixes bug #335912. --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ gtk/gtkmenu.c | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index c6f4d9e1fb..fd9e4cc5c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-27 Michael Natterer + + * gtk/gtkmenu.c (gtk_menu_scroll_by): bail out if there is no need + for scrolling (more obvious than adding additional conditions to + the scroll offset calculation). Fixes bug #335912. + 2006-03-27 Anders Carlsson * gtk/Makefile.am: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c6f4d9e1fb..fd9e4cc5c2 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2006-03-27 Michael Natterer + + * gtk/gtkmenu.c (gtk_menu_scroll_by): bail out if there is no need + for scrolling (more obvious than adding additional conditions to + the scroll offset calculation). Fixes bug #335912. + 2006-03-27 Anders Carlsson * gtk/Makefile.am: diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index cdba77ba7b..a31a670684 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -2983,6 +2983,10 @@ gtk_menu_scroll_by (GtkMenu *menu, gdk_drawable_get_size (widget->window, &view_width, &view_height); + if (menu->scroll_offset == 0 && + view_height >= widget->requisition.height) + return; + /* Don't scroll past the bottom if we weren't before: */ if (menu->scroll_offset > 0) view_height -= MENU_SCROLL_ARROW_HEIGHT; -- 2.30.2